from django.urls import re_path
from . import views

urlpatterns = [

    # 获取省份信息:
    # re_path(r'^areas/$', views.ProvinceAreasView.as_view()),
    re_path(r'^areas/$', views.Provinces.as_view()),
    # 子级地区
    # re_path(r'^areas/(?P<pk>[1-9]\d+)/$', views.SubAreasView.as_view()),
    re_path(r'^areas/(?P<pk>[1-9]\d+)/$', views.Subs.as_view()),

    # 新增收货地址
    re_path(r'^addresses/create/$', views.CreateAddressView.as_view()),

    # 访问地址的子路由:
    re_path(r'^addresses/$', views.AddressView.as_view()),
    re_path(r'^gaddresses/(?P<address_id>\d+)/$', views.AddressGenericAPIView.as_view()),

    # 修改和删除收货地址
    re_path(r'^addresses/(?P<address_id>\d+)/$', views.UpdateDestroyAddressView.as_view()),

    # 设置默认地址
    re_path(r'^addresses/(?P<address_id>\d+)/default/$', views.DefaultAddressView.as_view()),

    # 更新地址标题
    re_path(r'^addresses/(?P<address_id>\d+)/title/$', views.UpdateTitleAddressView.as_view()),

    # 修改密码
    re_path(r'^password/$', views.ChangePasswordView.as_view()),

]